Total Complexity | 1 |
Total Lines | 10 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | import { Inject } from '@nestjs/common'; |
||
5 | |||
6 | export class IsVoucherAlreadyGenerated { |
||
7 | constructor( |
||
8 | @Inject('IVoucherRepository') |
||
9 | private readonly voucherRepository: IVoucherRepository |
||
10 | ) {} |
||
11 | |||
12 | public async isSatisfiedBy(email: string, school: School): Promise<boolean> { |
||
13 | return ( |
||
14 | (await this.voucherRepository.findOneByEmailAndSchool(email, school)) instanceof Voucher |
||
15 | ); |
||
18 |